part of '../index.dart';

class ImGitfWrapperModel {
  int? id;
  String? name;
  int? sort;
  List<GiftVosModel> giftVos = [];

  ImGitfWrapperModel({
    this.id,
    this.name,
    this.sort,
    this.giftVos = const [],
  });

  factory ImGitfWrapperModel.fromJson(Map<String, dynamic> json) =>
      ImGitfWrapperModel(
        id: int.tryParse('${json['id']}'),
        name: '${json['name']}',
        sort: int.tryParse('${json['sort']}'),
        giftVos: (json['giftVos'] as List)
            .map((e) => GiftVosModel.fromJson(e))
            .toList(),
      );

  Map<String, dynamic> toJson() => {
        'id': id,
        'name': name,
        'sort': sort,
        'giftVos': giftVos,
      };
}

class GiftVosModel {
  int? id;
  int? type;
  GiftVosModel({this.id, this.type});
  factory GiftVosModel.fromJson(Map<String, dynamic> json) => GiftVosModel(
        id: int.tryParse('${json['id']}'),
        type: int.tryParse('${json['type']}'),
      );
  Map<String, dynamic> toJson() => {'id': id, 'type': type};
}
